<div id="search" class="input-group">
  <input type="text" name="search" value="{{ search }}" placeholder="{{ text_search }}" class="form-control input-lg" />
  <span class="input-group-btn">
    <button type="button" class="btn btn-default btn-lg"><i class="fa fa-search"></i></button>
  </span>
</div>
<script type="text/javascript"><!--
$(document).ready(function() { $('#search input[name=\'search\']').parent().find('button').off('click'); $('#search input[name=\'search\']').parent().find('button').on('click', function() { var url = '{{csp_search_url_param}}'; var value = $('header #search input[name=\'search\']').val(); if (value) {url = url.replace('%search%', encodeURIComponent(value));} else {url = '{{csp_search_url}}';} location = url; });});
--></script>